package com;

import org.springframework.util.FileCopyUtils;

import java.io.*;

/**
 * Author: tonggen
 * Date: 2019/7/11
 * time: 3:35 PM
 */
public class WugeTest {

    public static void main(String[] args) throws IOException {

        Reader inputStream = null;
        Writer outputStream = null;
        try {
            inputStream = new FileReader(new File("/Users/wuge/Desktop/test.txt"));
            File file = new File("/Users/wuge/Desktop/test1.txt");
            if (!file.exists()) {
                file.createNewFile();
            }
            outputStream = new FileWriter(file);
            int i;
            while ((i = inputStream.read()) != -1) {
                outputStream.write(i);
            }

        } catch (Exception e) {

        } finally {
            inputStream.close();
            outputStream.close();
        }

    }
}
